package com.tiancheng.onecode.service;

import com.tiancheng.onecode.model.request.ApplicationAccessTokenRequestVO;
import com.tiancheng.onecode.trade.model.request.order.OpenCancelOrderVO;
import com.tiancheng.onecode.trade.model.request.order.OpenCreateOrderBaseVO;
import com.tiancheng.onecode.trade.model.request.order.OpenOrderPayVO;
import com.tiancheng.onecode.trade.model.request.order.OpenOrderPrePayResVO;
import com.tiancheng.onecode.model.response.ApplicationAccessTokenResponseVO;

/**
 * @Author: kellen
 * @Description: 交易service
 * @Date: create in 2024/12/7 15:07
 */
public interface ITradeService {
    /**
     * 获取应用授权
     *
     * @param requestVO
     * @return
     */
    ApplicationAccessTokenResponseVO getAccessToken(ApplicationAccessTokenRequestVO requestVO);

    /**
     * 创建订单
     *
     * @param createOrderBaseVO 创建订单参数
     * @param authToken         认证token
     * @return
     */
    String createOrder(OpenCreateOrderBaseVO createOrderBaseVO, String authToken);

    /**
     * 关闭订单
     * @param openCancelOrderVO 关闭订单参数
     * @param authToken token
     * @return
     */
    Boolean close(OpenCancelOrderVO openCancelOrderVO, String authToken);

    /**
     * 订单支付
     * @param openOrderPayVO 支付参数
     * @param accessToken token
     * @return
     */
    OpenOrderPrePayResVO pay(OpenOrderPayVO openOrderPayVO, String accessToken);
}
